#include "IInput.h"
#include "..\Engine\IEngine.h"

/*Interface Input class not to be used  no defination for interface*/
/*It should act as base abstarct class*/

IInput::IInput(IEngine *engine): mEngine(engine)
{
}

IInput::~IInput()
{
}

void IInput::RegisterKeyPressed(KeyCodeType keyCode)
{
	mPressedKeys.push_back(keyCode);
}

void IInput::ResetInputs()
{
	mPressedKeys.clear();
}

bool IInput::IsKeyPressed(KeyCodeType keyCode)
{
	for(int i = 0; i < (int)mPressedKeys.size(); i ++)
	{
		if(mPressedKeys[i] == keyCode)
			return true;
	}

	return false;
}

KeyCodeType IInput::GetLastKeyPressed()
{
	if(mPressedKeys.size() > 0)
	{
		return mPressedKeys[0];
	}

	return -1;
}
